<!-- 所属项目-多选 -->
<template>
	<a-select :placeholder="placeholder" :options="projectList" mode="multiple" allow-clear />
	<!-- :field-names="{ value: 'id' }"
			@change="handleChange" -->
</template>
<script setup name="projectMultiSelect">
	import { ref, onMounted } from 'vue'
	import projectApi from '@/api/tjzy/project/projectApi'

	// ===========================================DATA======================================================
	const props = defineProps({
		modelValue: [String],
		placeholder: {
			type: String,
			default: '请选择所属项目'
		}
	})
	const projectList = ref([])
	// ===========================================LIFECYCLE HOOKS===========================================
	onMounted(() => {
		getProjectList()
	})
	// ===========================================METHODS==================================================
	const handleChange = (v) => {
		console.log('v', v)
	}
	// ===========================================REQUEST==================================================
	const getProjectList = () => {
		projectApi.listAllProject('', false).then((res) => {
			projectList.value = res
		})
	}
</script>
<style lang="less" scoped></style>
